<?php include show_tpl('public_uheader.htm'); ?>

<div style="width:100%; height:20px; background:#E9ECF3;"></div>

<?php include show_tpl('public_usider.htm'); ?>

<div id="page-wrapper" class="gray-bg">

	<div class="row wrapper wrapper-content">
		<div class="row">
			<div class="col-md-12">
				<div class="panel panel-default">
					<div class="panel-heading">
						<div class="panel-title">
							<em class="fa fa-list"></em>
                             商户添加&nbsp;&nbsp;
						</div>
                    </div>
					<div class="panel-body">
						<form method="get" class="form-inline m-b-xs" action="<?php echo url('user-add');?>" style="width:600px;">
							<div class="input-group" style="width:100%;margin-bottom:10px;">
								<span class="input-group-addon" style="width:100px;">用户名</span>
								<input type="text" class="form-control" name="username">
							</div>
							<div class="input-group" style="width:100%;margin-bottom:10px;">
								<span class="input-group-addon" style="width:100px;">邮箱</span>
								<input type="text" class="form-control" name="email">
							</div>
							<div class="input-group" style="width:100%;margin-bottom:10px;">
								<span class="input-group-addon" style="width:100px;">密码</span>
								<input type="password" class="form-control" name="password">
							</div>
							<div class="input-group" style="width:100%;margin-bottom:10px;">
								<span class="input-group-addon" style="width:100px;">确认密码</span>
								<input type="password" class="form-control" name="password">
							</div>
							<div class="input-group" style="width:100%;margin-bottom:10px;">
								<span class="input-group-addon" style="width:100px;">费率</span>
								<input type="text" class="form-control" name="rate" value="<?php echo $user['rate'];?>"><span class="input-group-addon" style="width:100px;">不得低于您自己的费率(<?php echo $user['rate']; ?>)</span>
							</div>
							<button class="btn btn-primary" type="submit" id="submit">提交</button>
						</form>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>

<?php include show_tpl('public_ufooter.htm'); ?>

<script>
	$('#submit').click(function(){
		var $this = $(this);
		$this.attr('disabled', '1');
		var postdata = $('form').serialize();
		$.post($('.form-ajax').attr('action'), postdata, function(message){
			alert(message.message);
			$this.attr('disabled', false);
			if(message.code==1) window.location.reload();
		}, 'json');
		return false;
	});
</script>